import {get,post} from "./http";

// 判断用户是否登录成功
export const login = (params) => post(`/login`,params);
//修改密码
export const UpdatePass = (params) => post(`/user/updatepass`,params);
//注册账号
export const register = (params) => post(`/register`,params)
//修改个人信息
export const updateMessage = (params) => post(`/user/updateMessage`,params)
//用户得到照片
export const getPic = (id) =>get(`getPic?id=${id}`)
//实时拿到用户的余额
export const getBalance = (id) =>get(`getBalance?id=${id}`)

//与game相关的
export const getGame  =() =>get(`/game/getGameAll`)
//根据id查询具体的game信息
export const getGameById = (id) => get(`/game/getGameById?id=${id}`)
//根据id查询该游戏拥有用户列表
export  const getGameList = (id) =>get(`/getListMess?id=${id}`)

//与充值相关得
export const recharge = (id) =>get(`/recharge?id=${id}`)
//购买游戏
export const buy = (id,gameId,sell) =>get(`buy?id=${id}&gameId=${gameId}&sell=${sell}`)
//根据用户id拿到它的所有game信息
export const getgamelist = (username) =>get(`/game/getgamelist?username=${username}`);
